<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>9. 回文数</title>
</head>

<body>

</body>

<script>
    /**
     * @param {number} x
     * @return {boolean}
     */
    var isPalindrome = function (x) {
        let result = false;
        if (x >= 0) {
            let num = x.toString().split("").reverse().join("") * 1;
            result = x === num;
        } else {
            result = false;
        }
        return result;
    };
    console.log(isPalindrome(10));
</script>

</html>